//拼接字符串
function setReportList(json,contain){
    if(!json){
        return;
    }
    if(json.status==200 && json.data.length>0) {
        var dataArr=json.data;
        var htmlStr="";
        for(var i=0;i<dataArr.length;i++){
            htmlStr+='<li data-key="'+dataArr[i].id+'">'+
                        '<a>'+
                            '<div class="imgWrapper_reportList"><img src="'+dataArr[i].imgUrl+'" alt=""></div>'+
                            '<dl class="description_reportList">'+
                                '<dd class="title_reportList">'+dataArr[i].title+'</dd>'+
                                '<dd class="label_reportList">商河气象局 '+dataArr[i].createTime+'</dd>'+
                            '</dl>'+
                        '</a>'+
                    '</li>'
        };

        contain.empty().html(htmlStr);

        contain.find('a').each(function(index,ele){
            $(this).bind('click',function(){
                $(this).attr('href',dataArr[index].weixinUrl)
            })
        });
    };
};

$.ajax({
    "url":"http://test.yulaile.cc/bootspr/weiXinImgFile/list",
    type:'GET', //POST
    async:true,    //或false,是否异步
    data:{
        //name:'yang',age:25
    },
    dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
    success:function(data){
        console.log(data)
        setReportList(data,$('#weatherReportList'));
    },
    error:function(e){
        console.log(e)
    }
});
